#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int x = 0;
    int y = 0;
    int m = 0;
    int n = 0;
    int count = 0;
    scanf("%d %d", &x, &y);
    for (int i = 0; i < 32; i++)
    {
        m = x & 1;
        x = x >> i;
        n = y & 1;
        y = y >> i;
        if (m == n)
        {
            count++;
        }
    }
    printf("%d\n", count);
    return 0;
}